package com.ddyx.util;

import java.util.Map;

import org.apache.commons.lang3.StringUtils;

public class PageUtil {

	public static Map<String, Object> isPage(Map<String, Object> param) {
		if (param.containsKey("isPage") && param.get("isPage") != null
				&& StringUtils.isNotBlank(param.get("isPage").toString()) && param.get("isPage").toString().equals("true")) {
			int start = 0;
			int size = 5;
			int page = Integer.parseInt(param.get("page").toString());
			if(page<1)
				page = 1;//默认第1页
			start = (page-1)*size;
			param.put("start", start);
			param.put("size", size);
		}
		return param;
	}
}
